define(['vue'],
  function (Vue) {
    function render() {
      new Vue({
        el: '#tmzk_test',
        data() {
          return {
            form: {
              // roleCode: null,
              roleCode: {
                code: 'SE',
                displayCn: '系统工程师'
              }
            },
            rules: {
              roleCode: [
                {
                  required: true,
                  tigger: 'change',
                  validator: (rule, value, callback) => {
                    if (!value) {
                      callback(new Error('请选择角色'))
                      return
                    }
                    callback()
                  }
                }
              ]
            }
          }
        },
        methods: {
          async submit() {
            console.log(this.form)
            await this.$refs.form.validate()
          },
        }
      })
    }
    return {
      init: render
    }
  })